package Final;

import java.util.Scanner;

public class test25 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        double length = scan.nextDouble();
        Square s = new Square(length);
        System.out.printf("%.2f ", s.getPerimeter());
        System.out.printf("%.2f\n", s.getArea());

        length = scan.nextDouble();
        double wide = scan.nextDouble();
        Rectangle r = new Rectangle(length, wide);
        System.out.printf("%.2f ", r.getPerimeter());
        System.out.printf("%.2f\n", r.getArea());

        double radius = scan.nextDouble();
        Circle c = new Circle(radius);
        System.out.printf("%.2f ", c.getPerimeter());
        System.out.printf("%.2f\n", c.getArea());

        scan.close();
    }
}

/* 你的代码被嵌在这里 */
class Shape {
    public double getPerimeter() {
        return 0;
    }

    public double getArea() {
        return 0;
    }
}

class Square extends Shape {
    double length;

    public Square(double length) {
        this.length = length;
    }

    @Override
    public double getPerimeter() {
        return 4 * length;
    }

    @Override
    public double getArea() {

        return length * length;
    }
}

class Rectangle extends Shape {
    double length;
    double width;

    public Rectangle(double length, double width) {
        this.length = length;
        this.width = width;
    }

    @Override
    public double getPerimeter() {
        return 2 * (length + width);
    }

    @Override
    public double getArea() {
        return length * width;
    }
}

class Circle extends Shape {
    double r;

    public Circle(double r) {
        this.r = r;
    }

    @Override
    public double getPerimeter() {
        return Math.PI * 2 * r;
    }

    @Override
    public double getArea() {
        return Math.PI * r * r;
    }
}